﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.SessionState;

namespace Shumisen.Web.Form
{
	public static class HttpSessionStateExtensions
	{
		public static SegmentState GetSegmentState(this HttpSessionState sessionState)
		{
			Gurad.ArgumentNotNull(sessionState, "sessionState");
			var segment = sessionState[HttpSessionStateNames.Segment] as SegmentState;
			if (segment == null)
			{
				// TODO 適切な例外
				throw new InvalidOperationException();
			}
			return segment;
		}
	}
}
